package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class BaseRegion implements Serializable {

	private static final long serialVersionUID = -1941312910228610792L;

	//fields
	private java.lang.Integer id;
	private java.lang.String cname;
	private java.lang.String ename;
	private java.lang.Integer parentId;
	private java.lang.String telCode;
	private java.lang.String path;
	private java.lang.String level;

	//default constructor
	public BaseRegion() {
	}

	//getter
	public java.lang.Integer getId() {
		return id;
	}
	public java.lang.String getCname() {
		return cname;
	}
	public java.lang.String getEname() {
		return ename;
	}
	public java.lang.Integer getParentId() {
		return parentId;
	}
	public java.lang.String getTelCode() {
		return telCode;
	}
	public java.lang.String getPath() {
		return path;
	}
	public java.lang.String getLevel() {
		return level;
	}

	//setter
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public void setCname(java.lang.String cname) {
		this.cname = cname;
	}
	public void setEname(java.lang.String ename) {
		this.ename = ename;
	}
	public void setParentId(java.lang.Integer parentId) {
		this.parentId = parentId;
	}
	public void setTelCode(java.lang.String telCode) {
		this.telCode = telCode;
	}
	public void setPath(java.lang.String path) {
		this.path = path;
	}
	public void setLevel(java.lang.String level) {
		this.level = level;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof BaseRegion))
			return false;

		final BaseRegion baseRegion = (BaseRegion)other;
		if (!this.id.equals(baseRegion.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("BaseRegion[")
			.append("id=").append(id).append(", ")
			.append("cname=").append(cname).append(", ")
			.append("ename=").append(ename).append(", ")
			.append("parentId=").append(parentId).append(", ")
			.append("telCode=").append(telCode).append(", ")
			.append("path=").append(path).append(", ")
			.append("level=").append(level).append("]").toString();
	}
}